<template>
  <div id="profile">
    <!--1.单独封装一个组件: 利用slot知识点-->
    <navbar class="titlenav">
        <template #centernav>我的</template>
    </navbar>
    
    <profilebody @nologin="nologin" v-if="islogin"></profilebody>
    <div class="tologin" v-else>
        <van-button type="primary" class="btn" @click="islogin=true">一键登录</van-button>
    </div>

  </div>
</template>

<script>
import navbar from '@/components/common/navbar/NavBar'
import profilebody from './childcomps/profilebody'
	export default {
        components:{
            navbar,
            profilebody
        },
        data() {
            return {
                islogin:false
            }
        },
        methods: {
            nologin(){
                this.islogin = false
            }
        },
    }
</script>

<style scoped>
 .titlenav{
     background-color: deeppink;
 }
 .tologin{
     margin-top: 40px;
 }
 .btn{
    
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
     width: 260px;
     height: 40px;
     border-radius: 19px;
 }
</style>